﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.Serialization;
using System.Xml.Linq;

namespace BbsbWebService.Tasks
{
    [DataContract]
    public class OneOffTask : BaseTask
    {
        public OneOffTask() { }

        public OneOffTask(DateTime nextAlarm)
            : base(nextAlarm)
        {
            SetNextAlarmMain();
        }

        public OneOffTask(XElement element)
            : base(element)
        {
            SetNextAlarmMain();
        }

        protected override void SetNextAlarm()
        {
            // Do nothing..
            NextAlarm = null;
        }

        protected override string AdditionalDesctiption
        {
            get { return string.Format(" on {0} only.", NextAlarm.Value.ToShortDateString()); }
        }

        protected override IEnumerable<XElement> GetRestAsXElement()
        {
            return null;
        }
    }
}
